"use strict";
const common_vendor = require("../common/vendor.js");
const composables_useManualTheme = require("../composables/useManualTheme.js");
const composables_useTabbar = require("../composables/useTabbar.js");
const __unplugin_components_9 = () => "../node-modules/wot-design-uni/components/wd-config-provider/wd-config-provider.js";
const __unplugin_components_8 = () => "../components/GlobalMessage.js";
const __unplugin_components_7 = () => "../components/GlobalToast.js";
const __unplugin_components_6 = () => "../components/GlobalLoading.js";
const __unplugin_components_5 = () => "../node-modules/wot-design-uni/components/wd-toast/wd-toast.js";
const __unplugin_components_4 = () => "../node-modules/wot-design-uni/components/wd-message-box/wd-message-box.js";
const __unplugin_components_3 = () => "../node-modules/wot-design-uni/components/wd-notify/wd-notify.js";
const __unplugin_components_2 = () => "../components/PrivacyPopup.js";
const __unplugin_components_1 = () => "../node-modules/wot-design-uni/components/wd-tabbar/wd-tabbar.js";
const __unplugin_components_0 = () => "../node-modules/wot-design-uni/components/wd-tabbar-item/wd-tabbar-item.js";
if (!Array) {
  const _component_wd_tabbar_item = __unplugin_components_0;
  const _component_wd_tabbar = __unplugin_components_1;
  const _component_privacy_popup = __unplugin_components_2;
  const _component_wd_notify = __unplugin_components_3;
  const _component_wd_message_box = __unplugin_components_4;
  const _component_wd_toast = __unplugin_components_5;
  const _component_global_loading = __unplugin_components_6;
  const _component_global_toast = __unplugin_components_7;
  const _component_global_message = __unplugin_components_8;
  const _component_wd_config_provider = __unplugin_components_9;
  (_component_wd_tabbar_item + _component_wd_tabbar + _component_privacy_popup + _component_wd_notify + _component_wd_message_box + _component_wd_toast + _component_global_loading + _component_global_toast + _component_global_message + _component_wd_config_provider)();
}
const __default__ = {
  options: {
    addGlobalClass: true,
    virtualHost: true,
    styleIsolation: "shared"
  }
};
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  ...__default__,
  __name: "tabbar",
  setup(__props) {
    const router = common_vendor.H();
    const route = common_vendor.E();
    const { themeVars, theme } = composables_useManualTheme.useManualTheme();
    const { activeTabbar, getTabbarItemValue, setTabbarItemActive, tabbarList } = composables_useTabbar.useTabbar();
    function handleTabbarChange({ value }) {
      setTabbarItemActive(value);
      router.pushTab({ name: value });
    }
    common_vendor.onMounted(() => {
      common_vendor.nextTick$1(() => {
        if (route.name && route.name !== activeTabbar.value.name) {
          setTabbarItemActive(route.name);
        }
      });
    });
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(common_vendor.unref(tabbarList), (item, index, i0) => {
          return {
            a: index,
            b: "554e1b3f-2-" + i0 + ",554e1b3f-1",
            c: common_vendor.p({
              name: item.name,
              value: common_vendor.unref(getTabbarItemValue)(item.name),
              title: item.title,
              icon: item.icon
            })
          };
        }),
        b: common_vendor.o(handleTabbarChange),
        c: common_vendor.p({
          ["model-value"]: common_vendor.unref(activeTabbar).name,
          bordered: true,
          ["safe-area-inset-bottom"]: true,
          placeholder: true,
          fixed: true
        }),
        d: common_vendor.p({
          ["theme-vars"]: common_vendor.unref(themeVars),
          ["custom-class"]: `page-wraper ${common_vendor.unref(theme)}`,
          theme: common_vendor.unref(theme)
        })
      };
    };
  }
});
wx.createComponent(_sfc_main);
